﻿using Microsoft.Win32;

namespace Wise.TimeWarrior.OSFunctionalitiesProxy.Impl
{
    /// <summary>
    /// <see cref="IUserSessionSystemEvents"/>
    /// </summary>
    public class UserSessionSystemEvents : IUserSessionSystemEvents
    {
        private SessionSwitchEventHandler sessionSw;
        /// <summary>
        /// <see cref="IUserSessionSystemEvents.SessionSwitched"/>
        /// </summary>
        public event SessionSwitchEventHandler SessionSwitched
        {
            add { sessionSw += value; }
            remove { if (sessionSw != null) sessionSw -= value; }
        }
        /// <summary>
        /// ctor
        /// </summary>
        public UserSessionSystemEvents()
        {
            SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
        }

        void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
        {
            if (sessionSw != null)
            {
                sessionSw(sender, e);
            }
        }



    }
}
